import datetime
from haystack import indexes
from haystack import site
from cab.models import Snippet


class SnippetIndex(indexes.SearchIndex):
    text = indexes.CharField(document=True, use_template=True)
    creator = indexes.CharField(model_attr='author')
    created = indexes.DateTimeField(model_attr='pub_date')
    title = indexes.DateTimeField(model_attr='title')
    url = indexes.DateTimeField(indexed=False, use_template=True)




site.register(Snippet, SnippetIndex)
